import {load} from '@/utils/loading.js'

/**
 * @description axios请求拦截器
 */
instance.interceptors.request.use(
  (config) => {
    if (
      config.data &&
      config.headers['Content-Type'] ===
      'application/x-www-form-urlencoded;charset=UTF-8'
    ) {
      config.data = qs.stringify(config.data)
    }
    if (debounce.some((item) => config.url.includes(item))) {
    }
    load.show() //在这 ~~~~~~~~
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)

/**
 * @description axios响应拦截器
 */
 instance.interceptors.response.use(
    (response) => {
      setTimeout(()=>{
      load.hide();//在这~~~~~~~
      },300)
    },
    (error) => {
        message.error(message || `后端接口未知异常`)
        return Promise.reject(error)
      }
    
  )
  